Skip to content

feat(ADMIN-262): 행사 페이지 기능 추가 및 로그인 권한 설정 - #2

Merged
seyun31 merged 7 commits into
mainfrom
feat/admin-262-login-api
Sep 9, 2025
Merged

feat(ADMIN-262): 행사 페이지 기능 추가 및 로그인 권한 설정#2
seyun31 merged 7 commits into
mainfrom
feat/admin-262-login-api

Conversation

@seyun31

@seyun31 seyun31 commented Sep 9, 2025

Copy link
Copy Markdown
Contributor
  • refactor: Header에서 로고 클릭 시 메인 페이지로 이동
  • feat: 관리자 확인 api 추가
  • refactor: 다른 페이지에서도 관리자만 접근 가능하도록 hook 분리 및 context 분리
  • feat: 모든 활동 조회 기능 추가
  • fix: 활동 참여 오류 해결
  • feat: 행사 수정, 삭제, 생성 기능 추가

Summary by CodeRabbit

  • New Features
    • 활동 관리 기능 추가: 목록 조회, 생성, 수정, 삭제 및 이벤트 테이블에서의 CRUD 모달 지원
    • QR 스캔을 통한 회원 참여 등록 흐름 통합
  • Authentication
    • 관리자 로그인 방식을 OAuth로 전환하고 전역 인증 컨텍스트/가드 도입
    • 미인증 사용자는 자동으로 로그인 화면으로 이동
  • UI/UX
    • 로딩 표시와 성공/실패 알림 강화, QR 스캐너 스로틀링·중복 방지 적용
    • 헤더 클릭 시 홈으로 이동
    • 스타일 유틸리티 클래스 추가 (호버 배경/폰트 크기)

@seyun31 seyun31 self-assigned this Sep 9, 2025
@coderabbitai

coderabbitai Bot commented Sep 9, 2025

Copy link
Copy Markdown

Caution

Review failed

The pull request is closed.

Walkthrough

관리자 인증/가드 도입과 OAuth 로그인 전환, 활동(Activity) 관리용 API 클라이언트 추가, 이벤트 테이블의 생성/수정/삭제 통합, QR 스캔 흐름의 내부 처리화, 헤더 내 네비게이션 추가, CSS 유틸 클래스 추가, 루트 렌더 트리에 AuthProvider 적용 및 관련 페이지들의 가드/데이터 연동이 반영되었습니다.

Changes

Cohort / File(s) Summary
Activity API 클라이언트 추가
src/api/activity/delete-acitivites.ts, src/api/activity/get-activities.ts, src/api/activity/get-qrcode.ts, src/api/activity/post-activities.ts, src/api/activity/post-memebr-activities.ts, src/api/activity/put-activities.ts
VITE_API_BASE_URL 기반 CRUD/조회 API 모듈 신규 추가: 활동 목록 조회, 단건 조회/수정, 생성, 삭제, QR 멤버 조회, 활동 참여 등록. 성공/실패를 불리언 또는 구조화된 결과로 반환하고 오류 로깅 포함.
Auth API 및 컨텍스트/가드
src/api/auth/members.ts, src/context/AuthContext.tsx, src/hooks/useAuthGuard.tsx, src/main.tsx
/members 호출로 ADMIN 여부 판별 함수 추가. AuthProvider로 인증 상태 관리 및 checkAuth 제공. useAuthGuard 훅으로 미인증 시 /login 리다이렉트. main에서 App을 AuthProvider로 감쌈.
이벤트/QR 컴포넌트 변경
src/components/EventTable.tsx, src/components/QRScanner.tsx
EventTable에 생성/수정/삭제 모달 및 API 연동 추가, props에 setRows 추가. QRScanner는 onScan 제거 후 내부에서 스캔 처리, QR 회원 조회 및 참여 등록, 스로틀링/중복 방지와 로컬 스토리지 의존 추가.
헤더 네비게이션
src/components/Header.tsx
헤더 클릭 시 루트로 네비게이션(useNavigate) 추가.
페이지 가드/데이터 연동
src/page/event.tsx, src/page/home.tsx
인증 가드 적용. Event는 인증 후 활동 목록을 불러와 테이블에 전달/갱신. Home은 로딩/미인증 상태 처리 추가.
로그인 페이지
src/page/login.tsx
Google OAuth 엔드포인트로 리다이렉트하는 단일 버튼 UI로 변경.
스타일 유틸리티
src/index.css
폰트 크기/hover 배경색 유틸 클래스 추가(주의: .font-size-18px 값 218px로 정의).

Sequence Diagram(s)

sequenceDiagram
  autonumber
  actor Admin as Admin(브라우저)
  participant EventPage as Event Page
  participant EventTable as EventTable
  participant ActivityAPI as Activity API(클라이언트)
  Note over EventPage: 마운트 후 인증 완료 시
  EventPage->>ActivityAPI: GetActivities()
  ActivityAPI-->>EventPage: Activity[]
  EventPage->>EventTable: rows, setRows 전달
  Admin->>EventTable: 생성/수정/삭제 조작
  alt 생성
    EventTable->>ActivityAPI: PostMemberActivities(name, pointAmount)
  else 수정
    EventTable->>ActivityAPI: updateActivity(id, name, point)
  else 삭제
    EventTable->>ActivityAPI: deleteActivity(id)
  end
  EventTable->>ActivityAPI: GetActivities() (갱신)
  ActivityAPI-->>EventTable: Activity[]
  EventTable-->>EventPage: setRows로 반영
Loading
sequenceDiagram
  autonumber
  actor Admin as Admin(브라우저)
  participant QRScanner as QRScanner
  participant LocalStorage as localStorage
  participant ActivityAPI as Activity API(클라이언트)
  Admin->>QRScanner: QR 모달 열기
  QRScanner->>LocalStorage: currentActivityId 읽기
  alt activityId 없음
    QRScanner-->>Admin: 경고 표시 후 닫기
  else activityId 있음
    Admin->>QRScanner: QR 스캔 결과(uuid)
    QRScanner->>ActivityAPI: GetQRCode(uuid)
    alt 회원 조회 성공
      ActivityAPI-->>QRScanner: MemberInfo
      QRScanner->>ActivityAPI: PostMemberActivities(activityId, memberId)
      ActivityAPI-->>QRScanner: 성공/실패
      QRScanner-->>Admin: 결과 알림 및 스로틀링 적용
    else 회원 조회 실패
      ActivityAPI-->>QRScanner: 오류
      QRScanner-->>Admin: 오류 알림 후 스캐너 정리/닫기
    end
  end
Loading
sequenceDiagram
  autonumber
  participant App as App
  participant AuthProvider as AuthProvider
  participant MembersAPI as /members API
  participant Route as Protected Page
  App->>AuthProvider: 마운트
  AuthProvider->>MembersAPI: Members()
  MembersAPI-->>AuthProvider: {role,name} 또는 오류
  AuthProvider-->>Route: isAuthenticated 상태 제공
  Route->>Route: useAuthGuard 검사
  alt 미인증
    Route->>Route: /login으로 이동
  else 인증
    Route-->>App: 콘텐츠 렌더
  end
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~75 minutes

Tip

👮 Agentic pre-merge checks are now available in preview!

Pro plan users can now enable pre-merge checks in their settings to enforce checklists before merging PRs.

  • Built-in checks – Quickly apply ready-made checks to enforce title conventions, require pull request descriptions that follow templates, validate linked issues for compliance, and more.
  • Custom agentic checks – Define your own rules using CodeRabbit’s advanced agentic capabilities to enforce organization-specific policies and workflows. For example, you can instruct CodeRabbit’s agent to verify that API documentation is updated whenever API schema files are modified in a PR. Note: Upto 5 custom checks are currently allowed during the preview period. Pricing for this feature will be announced in a few weeks.

Example:

reviews:
  pre_merge_checks:
    custom_checks:
      - name: "Undocumented Breaking Changes"
        mode: "warning"
        instructions: |
          Pass/fail criteria: All breaking changes to public APIs, CLI flags, environment variables, configuration keys, database schemas, or HTTP/GraphQL endpoints must be documented in the "Breaking Change" section of the PR description and in CHANGELOG.md. Exclude purely internal or private changes (e.g., code not exported from package entry points or explicitly marked as internal).

Please share your feedback with us on this Discord post.


📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

Cache: Disabled due to data retention organization setting

Knowledge Base: Disabled due to data retention organization setting

📥 Commits

Reviewing files that changed from the base of the PR and between 3351b31 and d63a30d.

📒 Files selected for processing (17)
  • src/api/activity/delete-acitivites.ts (1 hunks)
  • src/api/activity/get-activities.ts (1 hunks)
  • src/api/activity/get-qrcode.ts (1 hunks)
  • src/api/activity/post-activities.ts (1 hunks)
  • src/api/activity/post-memebr-activities.ts (1 hunks)
  • src/api/activity/put-activities.ts (1 hunks)
  • src/api/auth/members.ts (1 hunks)
  • src/components/EventTable.tsx (6 hunks)
  • src/components/Header.tsx (1 hunks)
  • src/components/QRScanner.tsx (1 hunks)
  • src/context/AuthContext.tsx (1 hunks)
  • src/hooks/useAuthGuard.tsx (1 hunks)
  • src/index.css (2 hunks)
  • src/main.tsx (1 hunks)
  • src/page/event.tsx (1 hunks)
  • src/page/home.tsx (1 hunks)
  • src/page/login.tsx (1 hunks)
✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat/admin-262-login-api

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@seyun31
seyun31 merged commit c13631f into main Sep 9, 2025
1 of 2 checks passed
@seyun31
seyun31 deleted the feat/admin-262-login-api branch September 9, 2025 11:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant